/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ar.edu.utn.frsf.tpae.a2012.g03.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author fededalla
 */
public abstract class Cuenta {
    private static final long serialVersionUID = 1L;
    protected Integer ctaId;
    private long ctaNro;
    private Date ctaFechApe;
    private double ctaSdoAct;
    private List<Movimiento> movList;
    private CuentaCorriente ctaCte;
    private CajaAhorro cjaAho;
    private Cliente ctaCliId;

    public Cuenta() {
    }

    public Cuenta(Integer ctaId) {
        this.ctaId = ctaId;
    }

    public Cuenta(Integer ctaId, long ctaNro, Date ctaFechApe, double ctaSdoAct) {
        this.ctaId = ctaId;
        this.ctaNro = ctaNro;
        this.ctaFechApe = ctaFechApe;
        this.ctaSdoAct = ctaSdoAct;
    }

    public Integer getCtaId() {
        return ctaId;
    }

    public long getCtaNro() {
        return ctaNro;
    }

    public void setCtaNro(long ctaNro) {
        this.ctaNro = ctaNro;
    }

    public Date getCtaFechApe() {
        return ctaFechApe;
    }

    public void setCtaFechApe(Date ctaFechApe) {
        this.ctaFechApe = ctaFechApe;
    }

    public double getCtaSdoAct() {
        return ctaSdoAct;
    }

    public void setCtaSdoAct(double ctaSdoAct) {
        this.ctaSdoAct = ctaSdoAct;
    }

    @XmlTransient
    public List<Movimiento> getMovList() {
        return movList;
    }

    public void setMovList(List<Movimiento> movList) {
        this.movList = movList;
    }

    public CuentaCorriente getCtaCte() {
        return ctaCte;
    }

    public void setCtaCte(CuentaCorriente ctaCte) {
        this.ctaCte = ctaCte;
    }

    public CajaAhorro getCjaAho() {
        return cjaAho;
    }

    public void setCjaAho(CajaAhorro cjaAho) {
        this.cjaAho = cjaAho;
    }

    public Cliente getCtaCliId() {
        return ctaCliId;
    }

    public void setCtaCliId(Cliente ctaCliId) {
        this.ctaCliId = ctaCliId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ctaId != null ? ctaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cuenta)) {
            return false;
        }
        Cuenta other = (Cuenta) object;
        if ((this.ctaId == null && other.ctaId != null) || (this.ctaId != null && !this.ctaId.equals(other.ctaId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Cta[ ctaId=" + ctaId + " ]";
    }
    
}

